home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 142 / Gekkan Dennou Club - 2000.3 Vol. 142 (Japan).7z / Gekkan Dennou Club - 2000.3 Vol. 142 (Japan) (Track 1).bin / tools / s_tool / recode.c < prev    next >
Text File  |  1999-06-04  |  16KB  |  783 lines

  1. #include    "JX250.H"
  2. #include    <sys\iocs.h>
  3. #include    <sys\dos.h>
  4. #include    <sys\scsi.h>
  5. #include    <stdio.h>
  6. #include    <stdlib.h>
  7.  
  8. //---- 上の群
  9. static    UNchar    b1[12*12]={
  10.         "11ab 22cd   "
  11.         "            "
  12.         "33ef 44gh   "
  13.         "            "
  14.         "5555 6666 77"
  15.         "5555 6666 77"
  16.         "            "
  17.         "AABBCCDDEEFF"
  18.         "        ZZ  "
  19.         "GGGGGGGGGGGG"
  20.         "            "
  21.         "ij          "
  22. };
  23.  
  24. int    RecX1,RecY1,RecX2,RecY2;
  25. int    RecVwBai;        // 0;x1  1;x2  2;x4 3;x8
  26.                 //-1;/2 -2;/4 -3;/8
  27.  
  28. int    RecPX,RecPY;
  29.  
  30. int    RecSavMode;        // 0;CUT 1;PIC 2;GLM 3;BMP 4;JPEG 5;RGB
  31.  
  32. UNchar    BaiStr[][8]={"","1/8","1/4","1/2","x1","x2","x4","x8"};
  33.  
  34. UNchar    FileStStr[][8]={
  35.         "DIR.",
  36.         "NAME",
  37.         "TIME",        // 0;dir 1;filename 2;日付 3;Size
  38.         "SIZE"
  39. };
  40.  
  41. int    ViewFileY;
  42.  
  43. extern    UNchar    msp[17];
  44. extern    int    DataMd;
  45. extern    int    PreDataMd;
  46.  
  47. /********************************************************
  48.     記録モード
  49. ********************************************************/
  50. int    RecodeMode()
  51. {
  52. int    _PreXV1,_PreYV1,_PreXV2,_PreYV2;
  53. MAP=&MapAdds[32*32];
  54. if ( RecX2==0 || RecY2==0 || RecX2>ScanDataX-1 || RecY2>ScanDataY-1 ){
  55.     RecX1=0;
  56.     RecY1=0;
  57.     RecX2=ScanDataX-1;
  58.     RecY2=ScanDataY-1;
  59. }
  60. _PreXV1 = PreXV1;
  61. _PreYV1 = PreYV1;
  62. _PreXV2 = PreXV2;
  63. _PreYV2 = PreYV2;
  64. //----- 画面制作
  65. RecodeModeDraw();
  66. //---- 動く
  67. Rec_move();
  68. //====== 画面を戻す
  69. MAP=MapAdds;
  70. Rec_PosDedraw();
  71. PreXV1 = _PreXV1;
  72. PreYV1 = _PreYV1;
  73. PreXV2 = _PreXV2;
  74. PreYV2 = _PreYV2;
  75. _iocs_crtmod(0x100+12);
  76. ViewScrren();
  77. PreviewView();
  78. return(0);
  79. }
  80. /*********************************
  81.  
  82. **********************************/
  83. void    RecodeModeDraw()
  84. {
  85. int    x,y;
  86. int    a;
  87. int    ssp;
  88. UNchar    *M;
  89. struct    _fillptr PP;
  90. TXCLS(1);
  91. AspScreen();
  92. _iocs_g_clr_on();
  93. GraphicV(0);
  94. ssp=_iocs_b_super(0);
  95. for(y=0;y<32;y++){
  96.     a=TADDS(0,y);
  97.     M=&MAP[(y)*32];
  98.     for(x=0;x<32;x++,a+=32)
  99.         GGSP16_64_S(a,*M++);
  100. }
  101. if ( ssp>=0 )
  102.     _iocs_b_super(ssp);
  103. //---- 文字
  104. p_12K(19*16,1*16+3,"原点X");
  105. p_12K(24*16,1*16+3,"原点Y");
  106. p_12K(19*16,3*16+3,"幅");
  107. p_12K(24*16,3*16+3,"高さ");
  108. //---- ロード/セーブ
  109. SwIconWaku(19*2,6*2,4*2,2*2);
  110. p_16K(19*2*8,6*2*8+8," セーブ");
  111. SwIconWaku(24*2,6*2,4*2,2*2);
  112. p_16K(24*2*8,6*2*8+8," ロード");
  113. //---- 画像
  114. p_12_sprintf(11*16+2+6,2,BaiStr[ RecVwBai+4 ]);
  115. //----
  116. Rec_SaveModeDraw();
  117. Rec_SortModeDraw();
  118. //----
  119. if ( FilerAllMode!=0 ){
  120.     // 0;関係ファイルのみ表示 1;全ファイル表示
  121.     GGREV(VADDS(0,19*16,30*16),32,16);
  122. }
  123. //---- ヂレクトリ
  124. PP.x1=19*16+1;
  125. PP.y1=14*16+1;
  126. PP.x2=30*16-1-1;
  127. PP.y2=30*16-1-1;
  128. PP.color=PalTable[15];
  129. _iocs_fill(&PP);
  130. //---- ファイルチェック
  131. FileSearch(0);
  132. ViewFiles(-1);
  133. ViewFiles(ViewFileY);
  134. //---- 画像表示
  135. MakeGammaTable(DataMd);
  136. ScanGraphView(RecPX,RecPY,0);
  137. Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  138. GraphicV(-1);
  139. }
  140. /**************************************************
  141.  
  142. **************************************************/
  143. int    Rec_move()
  144. {
  145. int    i,r,f;
  146. int    x,y,xx,yy,xo,yo,b;
  147. for(;;){
  148.     _dos_keysns();
  149.     _dos_change_pr();
  150.     xo=-1;
  151.     yo=-1;
  152.     do {
  153.         yy=( i=_ms_curgt_() )&0xFFFF;
  154.         xx=i>>16;
  155.         if ( xo!=xx || yo!=yy ){
  156.             f=Rec_fream_mousepos(xx,yy);
  157.             MsPat(msp[f+1]);
  158.             xo=xx;
  159.             yo=yy;
  160.         }
  161.         if ( _iocs_bitsns(3)&bit(7) ){
  162.             AspMode^=1;
  163.             AspScreen();
  164.             while( _iocs_bitsns(3)&bit(7) );
  165.         }
  166.     } while( MS_LSW()==0 && (b=MS_RSW())==0 );
  167.     if ( b!=0 ){
  168.         if ( xx>=2*8-2 && xx<16+256+2 && yy>=2*8-2 && yy<62*8+2 )
  169.             Rec_click_bar( xx,yy );
  170.     } elif ( f>=0 ){
  171.         // 枠内だ
  172.         if ( (_iocs_bitsns(0xE)&bit(0))==0 ){
  173.             Rec_move_fream(xx,yy,f);
  174.         } else {
  175.             MsPat(1);
  176.             Rec_new_fream(xx,yy);
  177.         }
  178.     } elif ( xx>=2*8-2 && xx<16+256+2 && yy>=2*8-2 && yy<62*8+2 ){
  179.         // 枠スキャン画面内だ
  180.         Rec_new_fream(xx,yy);
  181.     } else {
  182.         x=xx/16;
  183.         y=yy/16;
  184.                 //printf("%2d,%2d:%2d %02X   \r",x,y,f);
  185.         r=0;
  186.         if ( x>=19 && x<31 && y>=2 && y<14 ){
  187.             //--- 上のボックス
  188.             i=b1[(x-19)+(y-2)*12];
  189.             if ( i==' ' )
  190.                 continue;
  191.             //printf("\t\t<%02X>\r",i);
  192.             r=Rec_click_botton1( i,xx,yy );
  193.         } elif ( (x==13 || x==14) && y==0 ){
  194.             //---表示倍率
  195.             r=Rec_click_botton4(x);
  196.         } elif ( x==0 && ( y==1 || y==30 ) ){
  197.             //--- 縦バー(ボタン)
  198.             r=Rec_click_botton6(y,0);
  199.         } elif ( xx>=6 && xx<=9 && yy>=32 && yy<480 ){
  200.             //--- 縦バー
  201.             r=Rec_click_botton6(yy,1);
  202.         } elif ( y==31 && ( x==1 || x==15 ) ){
  203.             //--- 横バーボタン
  204.             r=Rec_click_botton7(x,0);
  205.         } elif ( yy>=501 && yy<=506 && xx>=32 && xx<15*16 ){
  206.             //--- 縦バー
  207.             r=Rec_click_botton7(xx,1);
  208.         } elif ( x>=19 && x<31 && y>=14 && y<30 ){
  209.             if ( x==30 ){
  210.                 // スクロールボタン
  211.                 r=Rec_click_roll( y-14 );
  212.             } else {
  213.                 // ファイル群
  214.                 r=Rec_click_files( y-14 );
  215.             }
  216.         } elif ( y==30 ){
  217.             //-- UNDER BAR
  218.             if ( x==19 || x==20 ){
  219.                 //---ALLor ??
  220.                 if ( FilerAllMode==0 ){
  221.                     FilerAllMode=1;
  222.                     // 書き直して反転
  223.                     GGSP16_OF(TADDS(19,30),MAP[19+30*32],MAP[20+30*32]);
  224.                     GGREV(VADDS(0,19*16,30*16),32,16);
  225.                     FileSearch(0);
  226.                     ViewFiles(-1);
  227.                     ViewFiles(ViewFileY);
  228.                 } else {
  229.                     // 書き直す
  230.                     FilerAllMode=0;
  231.                     GGSP16_OF(TADDS(19,30),MAP[19+30*32],MAP[20+30*32]);
  232.                     FileSearch(0);
  233.                     ViewFiles(-1);
  234.                     ViewFiles(ViewFileY);
  235.                 }
  236.             } else if ( x==24 || x==25 ){
  237.                 //---Sort内容変更
  238.                 r=Rec_click_botton1( (x==24)?'x':'y',xx,yy );
  239.             } else if ( x==27 || x==28 ){
  240.                 //---DEL
  241.                 Rec_PosDedraw();
  242.                 r=Rec_click_del();
  243.                 Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  244.             }
  245.         }
  246.         if ( r==99 )
  247.             return(0);
  248.     }
  249.     while( MS_LSW()!=0 || MS_RSW()!=0 ){
  250.         _dos_keysns();
  251.         _dos_change_pr();
  252.         yy=( i=_ms_curgt_() )&0xFFFF;
  253.         xx=i>>16;
  254.         if ( xo!=xx || yo!=yy ){
  255.             f=Rec_fream_mousepos(xx,yy);
  256.             MsPat(msp[f+1]);
  257.             xo=xx;
  258.             yo=yy;
  259.         }
  260.     }
  261. }
  262. return(r);
  263. }
  264. /**********************************************************
  265.         フレームとマウスの関係
  266. [rtn]    -1 ; 違うところ
  267.     0 ; 中
  268.     bit 0 ; 上        bit 1 ; 左
  269.     bit 2 ; 右        bit 3 ; 下
  270. **********************************************************/
  271. int    Rec_fream_mousepos(xx,yy)
  272. int    xx,yy;
  273. {
  274. int    r;
  275. if ( ScanData==0 )    // 「画像」のポインタ
  276.     return(-1);
  277. r=0;
  278. //--- 中
  279. if ( xx<PreXV1-2 || xx>PreXV2+2 || yy<PreYV1-2 || yy>PreYV2+2 )
  280.     return(-1);
  281. if ( xx<16-2 || xx>256+16+2 || yy<16-2 || yy>496+2 )
  282.     return(-1);
  283. //--- 上チェック
  284. if ( yy<PreYV1+6 ) r|=bit(0);
  285. //--- 左チェック
  286. if ( xx<PreXV1+6 ) r|=bit(1);
  287. //--- 下チェック
  288. if ( yy>PreYV2-6 ){
  289.      r&=nbit(0);
  290.      r|=bit(3);
  291. }
  292. //--- 右チェック
  293. if ( xx>PreXV2-6 ){
  294.      r&=nbit(1);
  295.      r|=bit(2);
  296. }
  297. return( r );
  298. }
  299. /********************************************************
  300.     座標表示
  301. ********************************************************/
  302. void    Rec_PosSetDraw(x1,y1,x2,y2)
  303. int    x1,y1,x2,y2;
  304. {
  305. int    i,f;
  306. int    ssp;
  307. int    vxo1,vyo1,vxo2,vyo2;
  308. if ( ScanData==0 ){    // 「画像」のポインタ
  309.     //- 原点
  310.     p_12W(32+272+2,32+2,"     ");
  311.     p_12W(32+352+2,32+2,"     ");
  312.     //- 幅,高さ
  313.     p_12W(32+272+2,64+2,"     ");
  314.     p_12W(32+352+2,64+2,"     ");
  315.     return;
  316. }
  317. ssp=_iocs_b_super(0);
  318. f=0;
  319. if ( x1>=0 ){
  320.     // セット
  321.     vxo1=PreXV1;
  322.     vyo1=PreYV1;
  323.     vxo2=PreXV2;
  324.     vyo2=PreYV2;
  325.     RecX1=x1;    RecY1=y1;
  326.     RecX2=x2;    RecY2=y2;
  327.     if ( RecX1==RecX2 )
  328.         RecX2++;
  329.     if ( RecY1==RecY2 )
  330.         RecY2++;
  331.     f=-1;
  332.     if ( RecVwBai>=0 ){
  333.         i=1<<RecVwBai;
  334.         PreXV1 = 16+(RecX1*i)-(RecPX*i);
  335.         PreYV1 = 16+(RecY1*i)-(RecPY*i);
  336.         PreXV2 = 16+((RecX2)*i)-(RecPX*i)+i-1;
  337.         PreYV2 = 16+((RecY2)*i)-(RecPY*i)+i-1;
  338.     } else {
  339.         i=1<<(-RecVwBai);
  340.         PreXV1 = 16+(RecX1/i)-(RecPX/i);
  341.         PreYV1 = 16+(RecY1/i)-(RecPY/i);
  342.         PreXV2 = 16+(RecX2/i)-(RecPX/i)-1;
  343.         PreYV2 = 16+(RecY2/i)-(RecPY/i)-1;
  344.     }
  345. }
  346. CRTVDISP_S();
  347. //- 原点
  348. p_12_sprintf(32+272+2,32+2,"%5d",RecX1);    //X
  349. p_12_sprintf(32+352+2,32+2,"%5d",RecY1);    //Y
  350. //- 幅,高さ
  351. p_12_sprintf(32+272+2,64+2,"%5d",(RecX2-RecX1+1));
  352. p_12_sprintf(32+352+2,64+2,"%5d",(RecY2-RecY1+1));
  353. if ( f!=0 ){
  354.     if ( vxo2>0 && vyo2>0 ){
  355.         DrawWaku(vxo1,vyo1,vxo2,vyo2,1,0);
  356.     } else {
  357.         CRTVDISP_S();
  358.     }
  359.     DrawWaku(PreXV1,PreYV1,PreXV2,PreYV2,1,-1);
  360. }
  361. if ( ssp>=0 )
  362.     _iocs_b_super(ssp);
  363. return;
  364. }
  365. /****************************
  366.     消し
  367. ****************************/
  368. void    Rec_PosDedraw()
  369. {
  370. DrawWaku(PreXV1,PreYV1,PreXV2,PreYV2,1,0);
  371. }
  372. /**********************************************************
  373.         枠移動
  374. **********************************************************/
  375. void    Rec_move_fream(sx,sy,fm)
  376. int    sx,sy,fm;
  377. {
  378. int    i,x,y,xo,yo,bi,bii;
  379. int    xx,yy,b;
  380. int    x1o,y1o,x2o,y2o;
  381. int    x1,x2,y1,y2;
  382. int    _RecX1,_RecY1;
  383. int    _RecX2,_RecY2;
  384. int    RPX,RPY;
  385. //--- 記憶
  386. _RecX1 = RecX1;
  387. _RecY1 = RecY1;
  388. _RecX2 = RecX2;
  389. _RecY2 = RecY2;
  390. x1o=y1o=-1;
  391. xo=-1;
  392. yo=-1;
  393. if ( RecVwBai>=0 ){
  394.     bi=1<<RecVwBai;
  395.     RPX=ScanDataX-(256/bi);
  396.     RPY=ScanDataY-(480/bi);
  397.     bii=32+32/bi;
  398. } else {
  399.     bi=1<<(-RecVwBai);
  400.     RPX=ScanDataX-(256*bi);
  401.     RPY=ScanDataY-(480*bi);
  402.     bii=16;
  403. }
  404. while( MS_LSW()!=0 && (b=MS_RSW())==0 ){
  405.     _dos_keysns();
  406.     _dos_change_pr();
  407.     yy=( i=_ms_curgt_() )&0xFFFF;
  408.     xx=i>>16;
  409.     if ( xo==xx && yo==yy )
  410.         continue;
  411.     xo=xx;
  412.     yo=yy;
  413.     {
  414.         int    _x,_y;
  415.         i=_iocs_ms_getdt();
  416.         //x1=(int)(char)((i>>24)&0xFF);;
  417.         //y1=(int)(char)((i>>16)&0xFF);;
  418.         _x=RecPX;
  419.         _y=RecPY;
  420.         if ( xx<16 ){
  421.             RecPX-=bii;
  422.             //RecPX-=-x1;
  423.             if ( RecPX<0 )
  424.                 RecPX=0;
  425.         }
  426.         if ( yy<16-3 ){
  427.             RecPY-=bii;
  428.             //RecPY-=-y1;
  429.             if ( RecPY<0 )
  430.                 RecPY=0;
  431.         }
  432.         if ( xx>256+16 ){
  433.             RecPX+=bii;
  434.             //RecPX+=x1;
  435.             if ( RecPX>=RPX ){
  436.                 RecPX=RPX-1+1;
  437.                 if ( RecPX<0 )
  438.                     RecPX=0;
  439.             }
  440.         }
  441.         if ( yy>496+3 ){
  442.             RecPY+=bii;
  443.             //RecPY+=y1;
  444.             if ( RecPY>=RPY ){
  445.                 RecPY=RPY-1+1;
  446.                 if ( RecPY<0 )
  447.                     RecPY=0;
  448.             }
  449.         }
  450.         if ( _x!=RecPX || _y!=RecPY ){
  451.             if ( RecVwBai>=0 ){
  452.                 sx+=(_x-RecPX)*bi;
  453.                 sy+=(_y-RecPY)*bi;
  454.                 xx+=(_x-RecPX)*bi;
  455.                 yy+=(_y-RecPY)*bi;
  456.             } else {
  457.                 sx+=(_x-RecPX)/bi;
  458.                 sy+=(_y-RecPY)/bi;
  459.                 xx+=(_x-RecPX)/bi;
  460.                 yy+=(_y-RecPY)/bi;
  461.             }
  462.             Rec_PosDedraw();
  463.             ScanGraphView(RecPX,RecPY,0);
  464.             //printf("PX=%2d,PY=%2d\r");
  465.             Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  466.             _iocs_ms_curst(xx,yy);
  467.         }
  468.     }
  469.     if ( RecVwBai>=0 ){
  470.         x=(xx-sx)/bi;
  471.         y=(yy-sy)/bi;
  472.     } else {
  473.         x=(xx-sx)*bi;
  474.         y=(yy-sy)*bi;
  475.     }
  476.     x1 = _RecX1;
  477.     y1 = _RecY1;
  478.     x2 = _RecX2;
  479.     y2 = _RecY2;
  480.     if ( fm==0 ){
  481.         //--- 全体ムーブ
  482.         //
  483.         if ( x<0 ){
  484.             if ( x1+x>=0 ){
  485.                 x1 += x;
  486.                 x2 += x;
  487.             } else {
  488.                 x2 -= x1;
  489.                 x1 -= x1;
  490.             }
  491.         } elif ( x>0 ){
  492.             if ( x2+x<=ScanDataX-1 ){
  493.                 x1 += x;
  494.                 x2 += x;
  495.             } else {
  496.                 x1 += (ScanDataX-1)-x2;
  497.                 x2 += (ScanDataX-1)-x2;
  498.             }
  499.         }
  500.         if ( y<0 ){
  501.             if ( y1+y>=0 ){
  502.                 y1 += y;
  503.                 y2 += y;
  504.             } else {
  505.                 y2 -= y1;
  506.                 y1 -= y1;
  507.             }
  508.         } elif ( y>0 ){
  509.             if ( y2+y<=ScanDataY-1 ){
  510.                 y1 += y;
  511.                 y2 += y;
  512.             } else {
  513.                 y1 += (ScanDataY-1)-y2;
  514.                 y2 += (ScanDataY-1)-y2;
  515.             }
  516.         }
  517.     } else {
  518.         // bit 0 ; 上    bit 1 ; 左
  519.         // bit 2 ; 右    bit 3 ; 下
  520.         if ( (fm&bit(0))!=0 ){
  521.             //上
  522.             if ( y<0 ){
  523.                 if ( y1+y>=0 )
  524.                     y1 += y;
  525.                 else    y1 = 0;
  526.             } else {
  527.                 if ( y1+y<=(y2-16) )
  528.                     y1 += y;
  529.                 else    y1 = (y2-16);
  530.             }
  531.         }
  532.         if ( (fm&bit(1))!=0 ){
  533.             //左
  534.             if ( x<0 ){
  535.                 if ( x1+x>=0 )
  536.                     x1 += x;
  537.                 else    x1 = 0;
  538.             } else {
  539.                 if ( x1+x<=(x2-16) )
  540.                     x1 += x;
  541.                 else    x1 = (x2-16);
  542.             }
  543.         }
  544.         if ( (fm&bit(2))!=0 ){
  545.             //右
  546.             if ( x<0 ){
  547.                 if ( x2+x>=(x1+16) )
  548.                     x2 += x;
  549.                 else    x2 = (x1+16);
  550.             } else {
  551.                 if ( x2+x<=ScanDataX-1 )
  552.                     x2 += x;
  553.                 else    x2 = (ScanDataX-1);
  554.             }
  555.         }
  556.         if ( (fm&bit(3))!=0 ){
  557.             //下
  558.             if ( y<0 ){
  559.                 if ( y2+y>=(y1+16) )
  560.                     y2 += y;
  561.                 else    y2 = (y1+16);
  562.             } else {
  563.                 if ( y2+y<=ScanDataY-1 )
  564.                     y2 += y;
  565.                 else    y2 = (ScanDataY-1);
  566.             }
  567.         }
  568.     }
  569.     if ( x1!=x1o || y1!=y1o || x2!=x2o || y2!=y2o ){
  570.         Rec_PosSetDraw(x1,y1,x2,y2);
  571.         x1o=x1;
  572.         y1o=y1;
  573.         x2o=x2;
  574.         y2o=y2;
  575.     }
  576. }
  577. if ( b!=0 ){
  578.     //右クリック キャンセル
  579.     Rec_PosSetDraw(_RecX1,_RecY1,_RecX2,_RecY2);
  580.     MsPat(-1);
  581.     while( MS_LSW()!=0 || MS_RSW()!=0 );
  582.     return;
  583. }
  584. return;
  585. }
  586. /**********************************************************
  587.         枠新規
  588. **********************************************************/
  589. void    Rec_new_fream(sx,sy)
  590. int    sx,sy;
  591. {
  592. int    i,m,n,x,y,xo,yo,bi;
  593. int    xx,yy,b;
  594. int    x1o,y1o;
  595. int    px1,py1,px2,py2;
  596. int    _RecX1,_RecY1;
  597. int    _RecX2,_RecY2;
  598. //--- 記憶
  599. _RecX1 = RecX1;
  600. _RecY1 = RecY1;
  601. _RecX2 = RecX2;
  602. _RecY2 = RecY2;
  603. x1o=y1o=-1;
  604. xo=-1;
  605. yo=-1;
  606. //--- はじめの位置を記憶
  607. if ( RecVwBai>=0 ){
  608.     bi=1<<RecVwBai;
  609.     px1=((sx-16+RecPX*bi))/bi;
  610.     py1=((sy-16+RecPY*bi))/bi;
  611. } else {
  612.     bi=1<<(-RecVwBai);
  613.     px1=((sx-16+RecPX/bi))*bi;
  614.     py1=((sy-16+RecPY/bi))*bi;
  615. }
  616. px2=px1+1;
  617. py2=py1+1;
  618. if ( px1<0 || py1<0 || px1>=ScanDataX || py1>=ScanDataY )
  619.     return;
  620. Rec_PosSetDraw(px1,py1,px2,py2);
  621. while( MS_LSW()!=0 && (b=MS_RSW())==0 ){
  622.     _dos_keysns();
  623.     _dos_change_pr();
  624.     yy=( i=_ms_curgt_() )&0xFFFF;
  625.     xx=i>>16;
  626.     if ( xo==xx && yo==yy )
  627.         continue;
  628.     xo=xx;
  629.     yo=yy;
  630.     if ( RecVwBai>=0 ){
  631.         x=((xx-16+RecPX*bi))/bi;
  632.         y=((yy-16+RecPY*bi))/bi;
  633.     } else {
  634.         x=((xx-16+RecPX/bi))*bi;
  635.         y=((yy-16+RecPY/bi))*bi;
  636.     }
  637.     m=px1;
  638.     n=py1;
  639.     if ( x>m ){
  640.         m=x;
  641.         x=px1;
  642.     }
  643.     if ( y>n ){
  644.         n=y;
  645.         y=py1;
  646.     }
  647.     if ( x<0 )
  648.         x=0;
  649.     if ( m>ScanDataX-1 )
  650.         m=ScanDataX-1;
  651.     if ( y<0 )
  652.         y=0;
  653.     if ( n>ScanDataY-1 )
  654.         n=ScanDataY-1;
  655.     Rec_PosSetDraw(x,y,m,n);
  656. }
  657. if ( b!=0 || (RecX2==RecX1+1 && RecY2==RecY1+1) ){
  658.     //右クリック キャンセル
  659.     Rec_PosSetDraw(_RecX1,_RecY1,_RecX2,_RecY2);
  660.     MsPat(-1);
  661.     while( MS_LSW()!=0 || MS_RSW()!=0 );
  662.     return;
  663. }
  664. return;
  665. }
  666. /**************************************************
  667.         files表示
  668. **************************************************/
  669. void    ViewFiles(y)
  670. int    y;
  671. {
  672. int    i,l,n;
  673. UNchar    buf[256];
  674. struct    _fillptr PP;
  675. if ( y<0 ){
  676.     buf[0]='A'-1+Drive;
  677.     buf[1]=':';
  678.     buf[2]=0;
  679.     p_12W(22*16-6+2,13*16+2,buf);
  680.     if ( jstrlen(Apath)<128/6 ){
  681.         p_12_sprintf(23*16+2,13*16+2,"%-21s",&Apath[3]);
  682.     } else {
  683.         l=jstrlen(Apath);
  684.         n=0;
  685.         for(i=0;i<l;i++){
  686.             if ( ZenChk(Apath[i]) ){
  687.                 i++;
  688.                 continue;
  689.             }
  690.             if ( Apath[i]=='\\' ){
  691.                 buf[n++]=i;
  692.             }
  693.         }
  694.         if ( n>=2 )
  695.             p_12_sprintf(23*16+2,13*16+2,".%-19s",&Apath[buf[n-2]]);
  696.         else    p_12_sprintf(23*16+2,13*16+2,".%-19s",&Apath[buf[n-1]]);
  697.     }
  698.     p_12_sprintf(19*16+2,11*16+2,"%-28s",Afile);
  699.     return;
  700. }
  701. if ( DDS_max<0 ){
  702.     PP.x1=19*16+1;
  703.     PP.y1=14*16+1;
  704.     PP.x2=30*16-1-1;
  705.     PP.y2=30*16-1-1;
  706.     PP.color=PalTable[15];
  707.     _iocs_fill( &PP);
  708.     p_12W(20*16,22*16,"NO DISK");
  709.     return;
  710. }
  711. for(l=0;l<16;l++){
  712.     n=l+y;
  713.     if ( n>=DDS_max )    /*バッファの数 -1なら、未挿入 */
  714.         break;
  715.     if ( DDS[n].atr&bit(4) ){
  716.         // ディレクトリ
  717.         if ( DDS[n].fext[0]!=0 ){
  718.             sprintf(buf,"%-18s.%-3s  <DIR>",
  719.                 DDS[n].fname,
  720.                 DDS[n].fext
  721.             );
  722.         } else {
  723.             sprintf(buf,"%-18s      <DIR>",
  724.                 DDS[n].fname
  725.             );
  726.         }
  727.     } else {
  728.         i=DDS[n].date;
  729.         if ( DDS[n].fext[0]!=0 ){
  730.             sprintf(buf,"%-18s.%-3s  %2d/%02d",
  731.                 DDS[n].fname,
  732.                 DDS[n].fext,
  733.                 //(80+(i>>25))%100,
  734.                 (i>>21)&0xF,(i>>16)&0x1F
  735.             );
  736.         } else {
  737.             sprintf(buf,"%-18s     %2d/%02d",
  738.                 DDS[n].fname,
  739.                 //(80+(i>>25))%100,
  740.                 (i>>21)&0xF,(i>>16)&0x1F
  741.             );
  742.         }
  743.     }
  744.     p_12W(19*16+1,14*16+2+l*16,buf);
  745. }
  746. if ( l<16 ){
  747.     PP.x1=19*16+1;
  748.     PP.x2=30*16-1-1;
  749.     PP.y1=14*16+l*16+1;
  750.     PP.y2=30*16-1-1;
  751.     PP.color=PalTable[15];
  752.     _iocs_fill( &PP);
  753. }
  754. return;
  755. }
  756. /********************************************************
  757.     ファイルモード表示
  758. ********************************************************/
  759. void    Rec_SaveModeDraw()
  760. {
  761. int    i,j,ssp;
  762. ssp=_iocs_b_super(0);
  763. for(i=0;i<=5;i++){
  764.     j=19+i*2;
  765.     if ( i==RecSavMode ){
  766.         GGSP16_ON_S(TADDS(j,9),MAP[j+(9)*32],MAP[j+1+(9)*32]);
  767.     } else {
  768.         GGSP16_OF_S(TADDS(j,9),MAP[j+(9)*32],MAP[j+1+(9)*32]);
  769.     }
  770. }
  771. if ( ssp>=0 )
  772.     _iocs_b_super(ssp);
  773. return;
  774. }
  775. /********************************************************
  776.     ファイルソートモード表示
  777. ********************************************************/
  778. void    Rec_SortModeDraw()
  779. {
  780. int    i,j,m,n,ssp;
  781. p_12W(22*16+4,30*16+2,FileStStr[FilerSortMode]);
  782. }
  783.